<style scoped lang="scss">
.ton{
    width: 100%;
    height: 30px;
    background: #db2f19;
    display: flex;
    span{
        color: #fff;
        font-size: 12px;
        margin: auto;
    }
}
.content{
    margin-left: 20px;
    margin-top: 10px;
}
</style>
<template>
    <div>
        <homeTop :showicon2="true" :showSearch="false"></homeTop>
        <div class="ton">
            <span>本模块知识仅供参考,如有需要,请在医院指导下使用</span>
        </div>
        <div class="content">
            <h3>{{ name }}</h3>
            <br>
            <span style="color: #4191eb;">[药品成分]</span>
            <br>
            <span>{{ DetailDataList.component }}</span>
            <br><br>
            <span style="color: #4191eb;">[用药禁忌]</span>
            <br>
            <span>{{ DetailDataList.mindMatter }}</span>
            <br><br>
            <span style="color: #4191eb;">[功能主治]</span>
            <br>
            <span>{{ DetailDataList.effect }}</span>
            <br><br>
            <span style="color: #4191eb;">[用法用量]</span>
            <br>
            <span>{{ DetailDataList.usage }}</span>
            <br><br>
            <span style="color: #4191eb;">[药品性状]</span>
            <br>
            <span>{{ DetailDataList.shape }}</span>
             <br><br>
            <span style="color: #4191eb;">[包装规格]</span>
            <br>
            <span>{{ DetailDataList.packing }}</span>
             <br><br>
            <span style="color: #4191eb;">[不良反应]</span>
            <br>
            <span>{{ DetailDataList.sideEffects }}</span>
             <br><br>
            <span style="color: #4191eb;">[贮藏条件]</span>
            <br>
            <span>{{ DetailDataList.storage }}</span>
        </div>
    </div>
</template>
<script setup lang="ts">
import { request } from '@/axios/request';
import { ref } from 'vue';
import { useRouter,useRoute } from 'vue-router';
import homeTop from '@/components/homeTop/index.vue'
import { getMedicineDetailData } from '@/api';
const router= useRouter()
const route = useRoute()
const name=JSON.parse(localStorage.getItem('yname')as string)
console.log(name);
const id=ref(route.params.id)
console.log(id);
const DetailDataList:any=ref([])
const getMedicineDetailDataList=async()=>{
    const {data:res}=await getMedicineDetailData({
        id: Number(id.value)
    })
    DetailDataList.value=res.result
    console.log(res.result); 
}
getMedicineDetailDataList()
</script>